<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>generator yield return function</title>
  <script>
    window.onload = function () {
      function * show (a, b) {
        console.log('a')
        console.log(a, b)
        let c = yield
        console.log(c)
        console.log('b')
        return 5
      }

      let obj = show(12, 5)
      let res1 = obj.next()
      console.log(res1)
      const res2 = obj.next(88)
      console.log(res2)
      // a, 12,5, 88, b {done: true, vaule: 5}
    }
  </script>
</head>
<body>
  
</body>
</html>